package com.bwie.common.result;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 统一错误码枚举
 */
@Getter
@AllArgsConstructor
public enum ErrorCode {
    // 系统通用错误
    SUCCESS(200, "操作成功"),
    SYSTEM_ERROR(500, "系统内部错误"),
    PARAM_ERROR(400, "参数校验失败"),
    RESOURCE_NOT_FOUND(404, "资源不存在"),
    BUSINESS_ERROR(1000, "业务逻辑异常"),

    // 用户模块错误
    USER_NOT_FOUND(1001, "用户不存在"),
    USER_NAME_DUPLICATE(1002, "用户名已存在"),
    PASSWORD_INCORRECT(1003, "密码错误");

    /**
     * 错误码
     */
    private final int code;

    /**
     * 错误消息
     */
    private final String message;
}